﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BLL;
using System.Data;
using TaoBaoProject.Common;
using Newtonsoft.Json;

namespace TaoBaoProject.Handlers.RegisterHandler
{
  /// <summary>
  /// Summary description for color
  /// </summary>
  public class color : IHttpHandler
  {

    public void ProcessRequest(HttpContext context)
    {
      context.Response.ContentType = "text/plain";

      ShopBLL shop = new ShopBLL();
      DataTable dtShop = shop.GetAllShops();
      string jsonStr = JsonOps.Dtb2Json(dtShop);



      //JsonSerializerSettings setting = new JsonSerializerSettings();
      //setting.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
      //string result = JsonConvert.SerializeObject(jsonStr, Formatting.Indented, setting);

      context.Response.Write(jsonStr);
    }

    public bool IsReusable
    {
      get
      {
        return false;
      }
    }
  }
}